<extend name="Public/common" />
<block name="body">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>新闻列表</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-3" style="float: right;">
                            <!-- <div class="input-group">
                                <input type="text" placeholder="请输入新闻标题" class="input-sm form-control"> <span class="input-group-btn">
                                <button type="button" class="btn btn-sm btn-primary"> 搜索</button> </span>
                            </div> -->
                        </div>
                    </div>
                    <div class="table-responsive">
                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th></th>
                                <th>新闻标题</th>
                                <th>新闻作者</th>
                                <th>发布时间</th>
                                <th>所属分类</th>
                                <th>新闻标签</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <volist name="newslist" id="newslist">
                                <tr>
                                    <td>
                                        <input type="checkbox" class="i-checks" name="input[]">
                                    </td>
                                    <td>{$newslist.title}</td>
                                    <td>{$newslist.author}</td>
                                    <td>{$newslist.create_time|date="Y-m-d H:i:s",###}</td>
                                    <td>{$newslist.cate_title}</td>
                                    <td>
                                        <if condition="$newslist['label'] eq 0">
                                            <span style="color: green;">普通</span>
                                        </if>
                                        <if condition="$newslist['label'] eq 1">
                                            <span style="color: red;">置顶</span>
                                        </if>
                                        <if condition="$newslist['label'] eq 2">
                                            <span style="color: blue;">推荐</span>
                                        </if>
                                        <if condition="$newslist['label'] eq 3">
                                            <span style="color: orange;">热点</span>
                                        </if>
                                    </td>
                                    <td>
                                        <if condition="$newslist['status'] eq 0">
                                            <span style="color: green">启用</span>
                                        </if>
                                        <if condition="$newslist['status'] eq 1">
                                            <span style="color: red">禁用</span>
                                        </if>
                                    </td>
                                    <td>
                                        <if condition="$newslist['status'] eq 0">
                                            <a href="{:U('News/setStatus',['id'=>$newslist['id'],'tableName'=>'News','status'=>1])}" class="ajax-status"><button type="button" class="btn btn-outline btn-danger btn-xs">禁用</button></a>
                                            <else/>
                                            <a href="{:U('News/setStatus',['id'=>$newslist['id'],'tableName'=>'News','status'=>0])}" class="ajax-status"><button type="button" class="btn btn-outline btn-primary btn-xs">启用</button></a>
                                        </if>
                                        <a href="{:U('News/detailnews',['id'=>$newslist['id']])}"><button type="button" class="btn btn-outline btn-primary btn-xs">详情</button></a>
                                        <a href="{:U('News/editnews',['id'=>$newslist['id']])}"><button type="button" class="btn btn-outline btn-default btn-xs">编辑</button></a>
                                        <a href="{:U('News/remove',['id'=>$newslist['id'],'tableName'=>'News','remove'=>1])}" class="ajax-remove"><button type="button" class="btn btn-outline btn-warning btn-xs">移除</button></a>                                    </td>
                                    </td>
                                </tr>
                            </volist>
                            </tbody>
                        </table>
                    </div>
                        <div style="text-align: center;">{$page}</div>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>
<script src="__JS__/http/ajax.js"></script>
</block>